package com.example;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @author Create By Liuqz
 * @date 2018/11/16 10:39
 */
public class StreamMatch {

    public static void main(String[] args) {
        Stream<Integer> stream = Arrays.stream(new Integer[]{1,2,3,4,5,6,7,8,9});

        boolean result = stream.allMatch(i -> i > 5);

        System.out.println(result);

        Stream<Integer> stream2 = Arrays.stream(new Integer[]{1,2,3,4,5,6,7,8,9});

        result = stream2.anyMatch(i -> i > 6);

        System.out.println(result);
    }
}
